package com.rickpan.dto.request;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.Max;

/**
 * 创建团队请求DTO
 */
@Schema(description = "创建团队请求")
public class CreateTeamRequest {

    @Schema(description = "团队名称", example = "开发团队Alpha", required = true)
    @NotBlank(message = "团队名称不能为空")
    @Size(min = 2, max = 50, message = "团队名称长度必须在2-50个字符之间")
    private String name;

    @Schema(description = "团队描述", example = "专注于RickPan核心功能开发")
    @Size(max = 500, message = "团队描述不能超过500个字符")
    private String description;

    @Schema(description = "最大成员数", example = "50", minimum = "2", maximum = "200")
    @Min(value = 2, message = "团队最少需要2个成员")
    @Max(value = 200, message = "团队最多支持200个成员")
    private Integer maxMembers = 50;

    @Schema(description = "团队头像URL", example = "https://example.com/avatar.jpg")
    @Size(max = 500, message = "头像URL不能超过500个字符")
    private String teamAvatarUrl;

    // 构造函数
    public CreateTeamRequest() {}

    public CreateTeamRequest(String name, String description, Integer maxMembers, String teamAvatarUrl) {
        this.name = name;
        this.description = description;
        this.maxMembers = maxMembers;
        this.teamAvatarUrl = teamAvatarUrl;
    }

    // Getter和Setter方法
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Integer getMaxMembers() {
        return maxMembers;
    }

    public void setMaxMembers(Integer maxMembers) {
        this.maxMembers = maxMembers;
    }

    public String getTeamAvatarUrl() {
        return teamAvatarUrl;
    }

    public void setTeamAvatarUrl(String teamAvatarUrl) {
        this.teamAvatarUrl = teamAvatarUrl;
    }

    @Override
    public String toString() {
        return "CreateTeamRequest{" +
                "name='" + name + '\'' +
                ", description='" + description + '\'' +
                ", maxMembers=" + maxMembers +
                ", teamAvatarUrl='" + teamAvatarUrl + '\'' +
                '}';
    }
}
